﻿<phone:PhoneApplicationPage
    x:Class="Undercover.View.WordPairPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:mv="clr-namespace:Undercover.ViewModel"
    xmlns:converter="clr-namespace:Undercover.ViewModel"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="True">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="Transparent" >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
            <TextBlock Text="编辑词组" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" DataContext="{Binding Source={StaticResource Locator}, Path=WordPair}">
            <StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" >
                <StackPanel.Resources>
                    <converter:BooleanToVisibility x:Key="BooleanToVisibilityConverter"/>
                </StackPanel.Resources>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="人"/>
                <TextBox HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding MajorityWord, Mode=TwoWay}" VerticalAlignment="Top" Width="456"/>
                <TextBlock HorizontalAlignment="Left" TextWrapping="Wrap" Text="傻子"/>
                <TextBox HorizontalAlignment="Left" TextWrapping="Wrap" Text="{Binding MinorityWord, Mode=TwoWay}" VerticalAlignment="Top" Width="456"/>
                <CheckBox Content="是否可交换词语" IsChecked="{Binding CanSwap, Mode= TwoWay}"/>
                <CheckBox Content="加入用户词库" IsChecked="{Binding AddToUserLibrary, Mode= TwoWay}"
                          Visibility="{Binding CanBeAddedToUserLibrary, Converter={StaticResource BooleanToVisibilityConverter}}"
                          />
            </StackPanel>
            <Button Content="取消" HorizontalAlignment="Left" VerticalAlignment="Bottom" Command="{Binding CancelCommand}"/>
            <Button Content="确定" HorizontalAlignment="Right" VerticalAlignment="Bottom"  Command="{Binding ConfirmCommand}"/>
        </Grid>
    </Grid>

</phone:PhoneApplicationPage>